import request from '@/utils/request_app'

// 更新手机号
export const changeUserPhoneApi = data => {
  return request({
    url: 'app/hosp/doctor/changePhone',
    method: 'post',
    data: data,
  })
}
// 更新用户头像()
export const changeAvatarApi = data => {
  return request({
    url: `app/hosp/doctor/updateAvatar?avatar=${data}`,
    method: 'post',
  })
}

// 注销账号
export const closeAccountApi = () => {
  return request({
    url: 'app/hosp/doctor/deleteAccount',
    method: 'get',
  })
}

//关注用户
export const followApi = data => {
  return request({
    url: `app/user/follow`,
    method: 'post',
    data: data,
  })
}

//取关用户
export const unFollowApi = data => {
  return request({
    url: `app/user/follow/cancel`,
    method: 'get',
    params: data,
  })
}

//检查是否互关
export const isMutual = data => {
  return request({
    url: `app/user/follow/isMutual`,
    method: 'get',
    params: data,
  })
}

//粉丝列表
export const fansListApi = data => {
  return request({
    url: `app/user/follow/fansList`,
    method: 'post',
    data: data,
  })
}

//获取消息新增粉丝数
export const unRedDotFan = data => {
  return request({
    url: `app/user/follow/redDot`,
    method: 'get',
  })
}

//重置粉丝消息数
export const resetDotFan = data => {
  return request({
    url: `app/user/follow/unRedDot`,
    method: 'get',
  })
}

//获取消息新增关注数
export const unRedFollow = data => {
  return request({
    url: `app/user/follow/redDotFollow`,
    method: 'get',
  })
}

//重置新增关注数
export const resetDotFollow = data => {
  return request({
    url: `app/user/follow/unFollowRedDot`,
    method: 'get',
  })
}

//移除粉丝
export const removeFan = data => {
  return request({
    url: `app/user/follow/remove`,
    method: 'get',
    params: data,
  })
}

//关注列表
export const followListApi = data => {
  return request({
    url: `app/user/follow/list`,
    method: 'post',
    data: data,
  })
}

//我的评论
export const commentListApi = data => {
  return request({
    url: `app/circle/comment/list`,
    method: 'post',
    data: data,
  })
}

//获取新增评论消息数
export const unRedDotComment = data => {
  return request({
    url: `app/circle/comment/redDot`,
    method: 'get',
    params: data,
  })
}

//重置评论消息评论数
export const resetDotComment = data => {
  return request({
    url: `app/circle/comment/unRedDot`,
    method: 'get',
    params: data,
  })
}

export default {
  changeUserPhoneApi,
  changeAvatarApi,
  closeAccountApi,
}

//收藏列表
export const favoriteList = data => {
  return request({
    url: `app/user/favorite/list`,
    method: 'post',
    data: data,
  })
}

//2022-10-12 修改用户信息接口
export const updateInfoApi = data => {
  return request({
    url: `app/user/info/update`,
    method: 'post',
    data: data,
  })
}
//获取消息评论列表
export const messageCommentList = data => {
  return request({
    url: `app/circle/comment/messageCommentList`,
    method: 'post',
    data: data,
  })
}

//判断是否可以私聊（如果用户发布过寻宠，转让，寄养动态，私聊不受限）
export const isPublishSearch = data => {
  return request({
    url: `app/circle/petAssistant/canTalk`,
    method: 'get',
    params: data,
  })
}

// 用户消息未读数
export const getNoreadMessageNum = () => {
  return request({
    url: 'app/user/info/unreadMsgNum',
    method: 'get',
  })
}
